package com.hfjyz.registration.service;

import java.util.List;

import com.hfjyz.registration.command.PrintInfoCommand;
import com.hfjyz.registration.dao.AdmissionDao;
import com.hfjyz.registration.dao.ApplyDao;
import com.hfjyz.registration.dao.DepartDao;
import com.hfjyz.registration.dao.OfficeDao;
import com.hfjyz.registration.model.Depart;
import com.hfjyz.registration.model.Exam;
import com.hfjyz.registration.model.Office;
import com.hfjyz.registration.object.PrintInfoBean;

public class PrintInfoServiceImpl extends AbstractServiceImpl implements
		PrintInfoService {
	private ApplyDao applyDao;
	private AdmissionDao admissionDao;
	private OfficeDao officeDao;
	private DepartDao departDao;

    public ApplyDao getApplyDao() {
        return applyDao;
    }

    public void setApplyDao(ApplyDao applyDao) {
        this.applyDao = applyDao;
    }

    public AdmissionDao getAdmissionDao() {
        return admissionDao;
    }

    public void setAdmissionDao(AdmissionDao admissionDao) {
        this.admissionDao = admissionDao;
    }

    public OfficeDao getOfficeDao() {
        return officeDao;
    }

    public void setOfficeDao(OfficeDao officeDao) {
        this.officeDao = officeDao;
    }

    public DepartDao getDepartDao() {
        return departDao;
    }

    public void setDepartDao(DepartDao departDao) {
        this.departDao = departDao;
    }

    @Override
    public List<PrintInfoBean> getPrintInfos(PrintInfoCommand cmd) {
        if (cmd.getPrintType() == 0) {
            return admissionDao.getPrintInfo(cmd.getExamId());
        } else {
            return applyDao.getPrintInfo(cmd.getExamId());
        }
    }

    @Override
    public List<Depart> listDepart(Exam exam) throws Exception {
        return departDao.listByExam(exam);
    }

    @Override
    public List<Office> listOffice(Exam exam) throws Exception {
        return officeDao.listByExam(exam);
    }

}
